
public class Aufgabe5 {
    /**
     * 
     * @author Christian Pysk
     * Matr.Nr: 1828317
     *
     */
    public static void main(String[] args) {
        //Testausgaben
        System.out.println(fakultaet(14));
        System.out.println(binomial(15,3));
        System.out.println(modLotto(15,3));

    }
    
    static public long fakultaet(long n){
      if (n>1) return n*fakultaet(--n);
       else return 1;
    }
    
    static public long binomial(long n, long k){
        if (n<k) return 0;
        else return fakultaet(n)/(fakultaet(k)*fakultaet(n-k));
    }
    
    static public long modLotto(long n, long k){
        return binomial(n,k)*fakultaet(k);
    }

}
